import request from '@/utils/request'

// 获取运费模板列表
export function getShippingTemplates() {
  return request({
    url: '/store/shipping-templates/page', // 你的后端接口
    method: 'get'
  })
}

// 创建砍价
export function createBargain(data) {
  return request({
    url: '/store/bargain/create',
    method: 'post',
    data: data
  })
}

// 更新砍价
export function updateBargain(data) {
  return request({
    url: '/store/bargain/update',
    method: 'put',
    data: data
  })
}

// 删除砍价
export function deleteBargain(id) {
  return request({
    url: '/store/bargain/delete?id=' + id,
    method: 'delete'
  })
}

// 获得砍价
export function getBargain(id) {
  return request({
    url: '/store/bargain/get?id=' + id,
    method: 'get'
  })
}

// 获得砍价分页
export function getBargainPage(params) {
  return request({
    url: '/store/bargain/page',
    method: 'get',
    params
  })
}
// 导出砍价 Excel
export function exportBargainExcel(params) {
  return request({
    url: '/store/bargain/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
